{% extends "base.html" %}

{% block content %}
<div class="container mt-5">
    <div class="row justify-content-center">
        <div class="col-md-6">
            <div class="card">
                <div class="card-header">
                    <h4 class="mb-0">注册新账号</h4>
                </div>
                <div class="card-body">
                    <form method="POST" action="">
                        {{ form.hidden_tag() }}
                        <div class="mb-3">
                            {{ form.username.label(class="form-label") }}
                            {{ form.username(class="form-control") }}
                            {% for error in form.username.errors %}
                            <span class="text-danger">{{ error }}</span>
                            {% endfor %}
                        </div>
                        <div class="mb-3">
                            {{ form.email.label(class="form-label") }}
                            {{ form.email(class="form-control") }}
                            {% for error in form.email.errors %}
                            <span class="text-danger">{{ error }}</span>
                            {% endfor %}
                        </div>
                        <div class="mb-3">
                            {{ form.password.label(class="form-label") }}
                            {{ form.password(class="form-control") }}
                            {% for error in form.password.errors %}
                            <span class="text-danger">{{ error }}</span>
                            {% endfor %}
                        </div>
                        <div class="d-grid">
                            {{ form.submit(class="btn btn-primary") }}
                        </div>
                    </form>
                </div>
                <div class="card-footer text-center">
                    <small>已有账号？ <a href="{{ url_for('auth.login') }}">点击登录</a></small>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %} 